package com.stm.bi.report.salesTrend;

import com.stm.bi.repository.dataobject.ods.OdsShopDO;
import org.springframework.stereotype.Component;

import java.util.function.Function;

import static com.stm.bi.constant.SalesTrendConstants.*;

@Component
public class SalesTrendDomainService {


    public static Function<OdsShopDO, String> getShopFormat(String formatType){

        return switch (formatType){
            case FORMAT_COOPERATIVE -> OdsShopDO::getCooperateFormat;
            case FORMAT_LIFE        -> OdsShopDO::getLifeFormat;
            case FORMAT_INVESTMENT  -> OdsShopDO::getInvestFormat;
            default -> shop -> "-99";
        };
    }
}
